package com.zuxia.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.zuxia.dao.impl.TitleDao;
import com.zuxia.entity.Title;
import com.zuxia.service.ITitleService;

@Service("titleService")
public class TitleService implements ITitleService{
	@Resource(name="titleDao")
	private TitleDao titleDao;
	
	public List<Title> findAll() {
		return titleDao.findAll();
	}

	@Override
	public String svaeTitle(Title title) {
		try {
			titleDao.saveTitle(title);
			return "yes";
		} catch (Exception e) {
			return "no";
		}
	}
	
	@Override
	public String updateTitle(Title title) {
		try {
			titleDao.updateTitle(title);
			return "yes";
		} catch (Exception e) {
			return "no";
		}
	}

	@Override
	public String deleteTitle(Title title) {
		try {
			titleDao.deleteTitle(title);
			return "yes";
		} catch (Exception e) {
			return "no";
		}
	}

	public List<Title> selectTitle1(Title title) {
		return titleDao.selectTitle1(title);
	}
		
	@Override
	public List<Title> selectTitle2(String titleindustry) {
		return titleDao.selectTitle2(titleindustry);
	}

}
